Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace the type checking using property return_type with direct is… #1044

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

JerryChen97
Copy link
Contributor

@JerryChen97 JerryChen97 commented Jan 22, 2025

Context:
In the deprecations of PL0.41, the property return_type of class MeasurementProcess will be deprecated very soon PennyLaneAI/pennylane#6841. Therefore, we would like to replace the use of return_type with the equivalent direct isinstance check. For individual string info use of these return types, we replace them with in-place strings.

Description of the Change:
4 files are changed with equivalents in-place:

  • pennylane_lightning/core/_adjoint_jacobian_base.py
  • pennylane_lightning/core/_version.py
  • pennylane_lightning/core/lightning_base.py
  • tests/test_measurements.py

Benefits:
Consistent with both v0.40 and v0.41 of PL

Possible Drawbacks:
Not aware of yet.

Related GitHub Issues:
[sc-71892]

Copy link
Contributor

Hello. You may have forgotten to update the changelog!
Please edit .github/CHANGELOG.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

Copy link

codecov bot commented Jan 22, 2025

Codecov Report

Attention: Patch coverage is 16.66667% with 10 lines in your changes missing coverage. Please review.

Project coverage is 27.36%. Comparing base (290c986) to head (8591013).

Files with missing lines Patch % Lines
pennylane_lightning/core/_adjoint_jacobian_base.py 14.28% 6 Missing ⚠️
pennylane_lightning/core/lightning_base.py 0.00% 4 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (290c986) and HEAD (8591013). Click for more details.

HEAD has 107 uploads less than BASE
Flag BASE (290c986) HEAD (8591013)
113 6
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #1044       +/-   ##
===========================================
- Coverage   98.10%   27.36%   -70.75%     
===========================================
  Files         233       29      -204     
  Lines       39079     2646    -36433     
===========================================
- Hits        38339      724    -37615     
- Misses        740     1922     +1182     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This reverts commit d06a8cbada45a4cb0500d3d9dd134b4b6527151e.
@JerryChen97 JerryChen97 self-assigned this Jan 22, 2025
@JerryChen97 JerryChen97 added the ci:use-gpu-runner Enable usage of GPU runner for this Pull Request label Jan 22, 2025
@JerryChen97 JerryChen97 added ci:build_wheels Activate wheel building. and removed ci:use-gpu-runner Enable usage of GPU runner for this Pull Request labels Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:build_wheels Activate wheel building.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants